
#ifndef MAINSCENE_H
#define MAINSCENE_H
#include "jiantou.h"
#include "ship.h"
#include <QWidget>
#include <Map.h>
#include <QTimer>
#include<QPaintEvent>
#include<QPen>
#include <math.h>
#include <QPolygonF>
class MainScene : public QWidget
{
    Q_OBJECT
public:
    explicit MainScene(QWidget *parent = nullptr);
    QTransform m_transform;
    void  initScene();
    void playGame();
    //绘图事件
    void paintEvent(QPaintEvent *event);
    //鼠标移动事件
    void mousePressEvent(QMouseEvent *event);
    void QPaintEvent1(QMouseEvent *event1);
    void time(int c,int d,int x,int y,QTimer *event,int b);
    //地图对象
    int a=1;
    int p;
    Map m_map;
    QTimer m_Timer;
    ship myship;
    Jiantou myjiantou;
    QTimer *mytimer;
    void setP(int q)
    {
        this->p = q;  //将传入的值赋给成员变量p
    }
    void paintEvent1(QPainter *event, int a,int b,int c,int d);
   bool m_paintEvent1Flag = false;
    int x1=0;
   int x2=0;
    int y1=0;
   int y2=0;
    bool bo=1;
};


#endif // MAINSCENE_H
